home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_18_(11-1984).d64
/
integer tic-tac
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
4KB
|
124 lines
100 PRINT"[152]":GOSUB1000:U$(1)="X":U$(2)="O":FORXX=55296TO56295:POKEXX,1:NEXTXX
103 S1$(1)="-":S1$(2)="+":DIMPO$(20):POKE53272,23:POKE53280,1:POKE53281,1:DIMI(3,3)
104 W$(1)="":W$(2)="":W$(3)="":Q$(1)="X"
105 PRINT"[147]":DEFFNA(A)=INT(RND(1)*(2*A)-A)+INT(RND(1)*2):C=42:Q$(2)="O"
106 A$(1)="TIC TAC TOE":A$(2)="[212]IC [212]AC [212]OE[146]"
107 REM**BY CRAIG EISLER FWCI MAY 12,1980**
110 FORT=1TO24:PRINT" [146]";:NEXTT
111 FORT=1024TO1063:POKET,C:POKET+960,C:NEXTT:FORT=1024TO1983STEP40
112 FORT=1024TO1983STEP40:POKET,C:POKET+39,C:NEXTT
113 PRINT"[201]NTEGER":FORU=1TO7:READO(U):NEXTU
114 FORG=1TO25:FORH=1TO2:PRINT""A$(H):FORT=1TO50:NEXTT,H,G
115 PRINT"[208]RESS [211][208][193][195][197][146] TO BEGIN":POKE198,0:WAIT198,1
116 PRINT"[147][212]HIS IS A GAME OF [201]NTEGER [212]IC [212]AC [212]OE."
118 PRINT"[217]OU AND ANOTHER PLAYER WILL BE GIVEN INTEGER ADDITION AND SUBT";
119 PRINT"RACTION
120 [153]"QUESTION TO WORK OUT"
121 [153]"(null)HOEVER IS RIGHT, GETS THE SPOT":[141]855
122 [153]"CHR$OOD LUCK!"
123 [153]"(null)RESS SPACEWAIT":[151]198,0:[146]198,1:[153]"LOAD"
124 [153]"(null)HAT LEVEL?CMDCMDCMDCMDCMDCMDCMDCMDCMDCMDCMD(1-EASY 7-HARD)
125 GETA$:A=VAL(A$):IFA$=""ORA<1ORA>7THEN125
126 A1=A:A=O(A):PRINT"[147]":POKE53272,21
130 FORT=1026+242TO1026+274:POKET,120:POKET+54272,0:POKET+280,120:POKET+54552,0:NEXTT
132 PRINT"":FORP=1TO18:PRINTTAB(13);"[182]";TAB(26);"[182]":NEXTP:GOSUB1600
133 S$=""
135 FORL=1TO2:GOSUB500:PRINTS$"PLAYER "Q$(L)" WHICH BOX?"
136 GETA$:D=VAL(A$):IFA$=""ORD<1ORD>9THEN136
137 IFP(D)=1THENGOSUB500:PRINT"[145]USED":FORM=1TO500:NEXTM:PRINT"BOX #?":GOTO136
138 R=0:P(D)=1:GOSUB500
140 FORT1=1TOA1+1:Q=FNA(A):I=INT((RND(1)*2)+1):D7=Q:IFI=1THENR=R-Q
141 IFI=2THENR=R+Q
142 GOSUB550
143 PRINTS1$(I);Q;:Q=0:NEXTT1:PRINT"=";
144 GOSUB700:GOSUB500
145 IFP1<>RTHENPRINT"NOPE":FORYY=1TO500:NEXTYY:GOSUB500:P(D)=0:GOTO190
146 GOSUB900
147 IFD=1ORD=4ORD=7THEND1=1
148 IFD=2ORD=5ORD=8THEND1=2
149 IFD=3ORD=6ORD=9THEND1=3
150 ONLGOSUB200,205
152 IFD=1ORD=2ORD=3THENI$(1,D)=U$(L)
153 IFD=4ORD=5ORD=6THENI$(2,D-3)=U$(L)
154 IFD=7ORD=8ORD=9THENI$(3,D-6)=U$(L)
156 FORV=1TO3
157 IFI$(V,1)=U$(L)ANDI$(V,2)=U$(L)ANDI$(V,3)=U$(L)THEN600
158 NEXTV
159 FORV=1TO3
160 IFI$(1,V)=U$(L)ANDI$(2,V)=U$(L)ANDI$(3,V)=U$(L)THEN600
161 NEXTV
162 IFI$(1,1)=U$(L)ANDI$(2,2)=U$(L)ANDI$(3,3)=U$(L)THEN600
163 IFI$(1,3)=U$(L)ANDI$(2,2)=U$(L)ANDI$(3,1)=U$(L)THEN600
190 NEXTL:GOTO135
200 PRINTE$(D);L$(D1)"[205] [206]"
201 PRINTL$(D1)" [214]"
202 PRINTL$(D1)"[206] [205]":RETURN
205 PRINTE$(D);L$(D1)"[213][195][195][201]"
206 PRINTL$(D1)"[194] [200]"
207 PRINTL$(D1)"[202][198][198][203]":RETURN
500 FORT5=1024+(40*20)TO1024+(40*24):POKET5,32:NEXTT5:RETURN
550 IFT1=1THENR=D7:I=0:RETURN
551 RETURN
600 GOSUB1100
601 PRINT"ANOTHER ROUND?"
602 GETA$:IFA$=""THEN602
603 IFA$="Y"THENPRINT"[147]":FORG=1TO9:P(G)=0:NEXTG:POKE53272,23:GOTO123
605 PRINT"FINE...GOOD-BYE"::END
700 W$="":P1=0:FORTY=1TO20
702 GETB$(TY):IFB$(TY)=""THEN702
703 IFB$(TY)="@"THENPRINT"DELETED[146]";:PRINT"?=";:GOTO700
704 PRINTB$(TY);
705 IFB$(TY)=CHR$(13)THEN707
706 NEXTTY:RETURN
707 FORGG=1TOTY
708 W$=W$+B$(GG):NEXTGG:P1=VAL(W$):RETURN
850 PRINT"[147]CAT'S GAME!!!"
851 FORTH=1TO500:NEXTTH:GOTO2000
855 PRINT"PRESS SPACE[146]":POKE198,0:WAIT198,1:PRINT"[147]"
856 PRINT"[193]FTER YOU'VE TYPED AN ANSWER, PRESS THE [210][197][212][213][210][206][146] BUTTON"
858 PRINT"[201]F YOU MAKE A MISTAKE,TYPE THE @[146] KEY, AND YOUR ANSWER WILL BE
859 [153]"DELETED AND YOU MAY RETYPE IT"
860 [153]"":[142]
900 SS$(1)[178]"*CORRECT*WAIT":SS$(2)[178]" CORRECT ":SS$[178]""
901 [129]TG[178]1[164]50:[129]TJ[178]1[164]2:[153]SS$;SS$(TJ);:[153]SS$;:[130]TJ:[130]TG
902 PP[178]PP[170]1:[139]PP[178]9[167]850
903 [142]
1000 E$(1)[178]"":E$(4)[178]"":E$(7)[178]""
1001 E$(2)[178]"":E$(5)[178]"":E$(8)[178]"":L$(1)[178]""
1002 E$(3)[178]"":E$(6)[178]"":E$(9)[178]""
1004 L$(2)[178]"":L$(3)[178]""
1005 [142]
1006 [131]7,15,23,30,37,45,50
1100 [153]"LOAD":S$[178]U$(L):[129]X[178]1[164]20
1110 [153][163]X);" TO "
1111 [153][163]X);" FN(null) "
1112 [153][163]X);" FN (null) "
1114 [153][163]X);" FN (null)TOTOTOTOTO "
1115 [153][163]X);" FN"S$" FN (null) "
1117 [153][163]X);" FNWINS!WAITTAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB((null) "
1120 [153][163]X);" (null)TOTOTOTOTOTOTOTOTOTOTOTOTOTO(null) "
1130 [129]YY[178]1[164]35:[130]YY:[153]"":[130]X:[137]601
1600 BG[178]1:[129]TG[178]11[164]36[169]12:[153]"";[163]TG);BG:BG[178]BG[170]1:[130]TG
1601 [129]TG[178]11[164]36[169]12:[153]"";[163]TG);BG:BG[178]BG[170]1:[130]TG
1602 [129]TG[178]11[164]36[169]12:[153]"";[163]TG);BG:BG[178]BG[170]1:[130]TG
1603 [142]
2000 [143]
2003 [153]" (null)(null)TO(null)(null)
2004 PRINT"
2005 [153]" (null)FN FN(null)WAIT (null)WAITTHEN
2007 PRINT" [206][206] [165] [167]
2008 [153]" (null)(null) (null)MID$ASC(null)(null)
2009 PRINT" [205][205][164][164][164][164][164][164][164] [202] [203]
2010 [153]" (null) (null)(null)(null)
2013 PRINT" [205] [163][205] [206][205]
2015 [153]" (null)STR$(null)(null)STR$STR$STR$STR$(null)(null) (null)(null)
2017 PRINT" [223][146] [166][223][146] [166][223][146] [166][223][146]"
2020 FORYI=1TO1000:NEXTYI:PRINT"":GOSUB2100:FORYI=1TO3000:NEXT:GOTO601
2100 PRINTTAB(24);" [213][196][196][196][196][196][201]
2102 [153][163]24);" CHR$HEH- LEFT$
2103 PRINTTAB(24);" [199] HEH![200]
2104 [153][163]23);"(null)RIGHT$MID$ASCASCASCASCASC(null)
2105 PRINTTAB(21);"[213][201][202][203]
2106 [153][163]21);"MID$(null)
2110 RETURN